package com.hch.maker.template.enums;

import cn.hutool.core.util.StrUtil;

/**
 * @author hch
 * @version 1.0
 * @description 文件过滤枚举类
 * @date 2024/7/27 20:32
 */

public enum FileFilterRangeEnum {
    FILE_NAME("文件名字","fileName"),
    FILE_CONTENT("文件内容","fileContent");


    private String text;


    private String value;

    FileFilterRangeEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public String getText(){
        return this.text;
    }
    public String getValue(){
        return this.value;
    }

    public static FileFilterRangeEnum getEnumByValue(String value){
        if(StrUtil.isBlank(value)){
            return null;
        }
        for (FileFilterRangeEnum fileFilterRuleEnum : FileFilterRangeEnum.values()) {
            if(value.equals(fileFilterRuleEnum.getValue())){
                return fileFilterRuleEnum;
            }
        }
        return null;
    }
}
